package com.topfinance.cnaps2.web.sys;

import java.util.HashMap;
import java.util.List;

import com.topfinance.cnaps2.ebo.TblTxDetailEbo;
import com.topfinance.cnaps2.service.ITblTxDetailManager;
import com.topfinance.frame.web.BaseSupport;
import com.opensymphony.xwork2.ModelDriven;

/**
 * <p>
 * Description:
 * </p>
 * 
 * @author
 * @version 1.50
 *          <p>
 *          Copyright: Copyright (c) 2004 2005
 *          </p>
 *          <p>
 *          Company:
 *          </p>
 */
public final class TblTxDetailAction extends BaseSupport implements ModelDriven<TblTxDetailEbo> {

	private ITblTxDetailManager tblTxDetailManager = null;

	private TblTxDetailEbo transEbo = new TblTxDetailEbo();

	public TblTxDetailEbo getModel() {
		return transEbo;
	}

	public void setTblTxDetailManager(ITblTxDetailManager tblTxDetailManager) {
		this.tblTxDetailManager = tblTxDetailManager;
	}

	public TblTxDetailAction() {
		super();
	}

	public String execute() {
		return list();
	}

	public String list() {
		log.debug("TblTxDetailAction-list begin");
		if (request.getParameter("auditid") == null) {
			rtnResultMap = new HashMap();
			String[] args = new String[1];
			args[0] = "";// you can add extra message here
			rtnResultMap.put("info", getText("expect.valid.pk.data", args));
			return SUCCESS;
		}
		try {
			String auid = request.getParameter("auditid");
			List l = tblTxDetailManager.getAllTblTxDetailList(auid);
			rtnResultMap = new HashMap();
			rtnResultMap.put(DATA_LIST_ROOT, l);
			rtnResultMap.put(RECORDS_COUNT, l.size());
		} catch (Exception e) {
			handleException(e);
		}
		log.debug("TblTxDetailAction-list end");
		return SUCCESS;
	}

	public TblTxDetailEbo getCfgTransPortInfoEbo() {
		return transEbo;
	}

	public void setCfgTransPortInfoEbo(TblTxDetailEbo transEbo) {
		this.transEbo = transEbo;
	}
}
